<?php
class Mivec_Element_Array extends Mivec_Element_Abstract 
{
	protected $_param;
	protected $_arr;
	protected $_str;
	protected $_separator;
	
	public function __construct($arr)
	{
		$this->_arr = $arr;
		return $this;
	}
	
	public function toString($separator=',')
	{
		if ($this->_arr) {
			$_str = '';
			foreach ($this->_arr as $_val) {
				$_str.= $_val . $separator;
			}
			$_str = trim($_str,$separator);
			
			return $_str;
		}
	}
	
	public function destory($pos='front',$_keyArr = '')
	{
		switch($pos) {
			case 'front': {
				unset($this->_arr[0]);
				break;
			}
			case 'specific':{
				break;
			}
			case 'end': {
				unset($this->_arr[count($this->_arr) - 1]);
				break;
			}
		}
		return $this;
	}
	
	public function get($pos="")
	{
		if ($pos == 'front') {
			$_val = $this->_arr[0];
		}else if ($pos == 'end') {
			$_val = $this->_arr[count($this->_arr) - 1];
		}else {
			$_val = $this->_arr;
		}
		return $_val;
	}
}
